<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <base href="<%=basePath%>">
    <link type="text/css" href="css/base.css" rel="stylesheet"/>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/menu.js"></script>
    <title>通知管理</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript">
        function actionEvent() {
            var form = document.getElementById("myform");
            if (ValidateIsSelect(form.all, form.fileList)) {
                form.action = "Information!delete.action";
                form.submit();
            } else {
                alert("请选择要操作的记录");
            }
        }

        /*
         *判断是否选择了记录
         */
        function ValidateIsSelect(allobj, items) {
            if (items.length > 0) {
                for (var i = 0; i < items.length; i++) {
                    if (items[i].checked) {
                        return true;
                    }
                }
            } else {
                if (items.checked)return true;
            }
            return false;
        }
        /*
         *全选
         */
        function allselect(allobj, items) {
            var state = allobj.checked;
            if (items.length > 0) {
                for (var i = 0; i < items.length; i++) {
                    if (!items[i].disabled) {
                        items[i].checked = state;
                    }
                }
            } else {
                if (!items.disabled)items.checked = state;
            }
        }
    </script>
</head>
<body>
<%@ include file="/page/share/menu.jsp" %>
<div id="content">
    <h2>通知管理</h2>
    <form method="post" action="/page/informationManagement/upload.jsp" id="myform">
    <table align="center" style="margin: 40px auto 20px;background: #114a93;opacity:0.9;font-family: '微软雅黑',serif;color: linen;width:
    800px;text-align: center">
        <tr>
            <td><label>
                <input type="checkbox" name="all" onclick="allselect(this,this.form.fileList)">
            </label></td>
            <td>通知文件</td>
            <td>上传时间</td>
        </tr>
        <s:iterator value="information" status="d">
            <s:set name="index" value="#d.getIndex()"/>
            <tr style="border: 1px #757575 solid">
                <td>
                    <input type="checkbox" value="<s:property value="information.get(#index).get(0)"/><s:property value="information.get(#index).get(1)"/>" name="fileList">
                </td>
                <td>
                    <a href="Information!show.action?fileName=<s:property value="information.get(#index).get(0)"/><s:property value="information.get(#index).get(1)"/>">
                        <s:property value="information.get(#index).get(1)"/></a></br>
                </td>
                <td>
                    <s:property value="information.get(#index).get(0)"/>
                </td>
            </tr>
        </s:iterator>
    </table>
    <table>
        <tr>
            <td>
                <input align="center" type="submit" name="review" value="上传"
                       onMouseOver="this.style.background='#2569c1'"
                       onmouseout="this.style.background='#114a93'"
                       style="width:80px;height:30px;margin:6px 0 0 550px ;cursor:pointer;border: none;
                    background: #114a93;color: white;font-size: 16px;">
            </td>
            <td>
                <input align="center" type="button" name="review" onclick="actionEvent()" value="删除"
                       onMouseOver="this.style.background='#2569c1'"
                       onmouseout="this.style.background='#114a93'"
                       style="width:80px;height:30px;margin:6px 0 0 50px ;cursor:pointer;border: none;
                    background: #114a93;color: white;font-size: 16px;">
            </td>
        </tr>
    </table>
    </form>


</div>

<div id="footer">
    <p style="text-align: center;color: #757575;padding: 20px 0px 0px 0px; font:12px;">Copyright © 2010-2013 蓝天白云团队
        版权所有</p>
</div>

</body>
</html>
